using System.Windows.Forms;
using pub.CmdUI.Cmd;
using pub.CmdUI.UI.Control;

namespace todo.Cmd.Edit
{
    public class UndoCmd : DefaultCmd, ICmdState
    {
        public UndoCmd()
        {
            Shortcut = new CmdShortcut(Keys.Control | Keys.Z);
        }

        bool ICmdState.Enabled
        {
            get { return TodoApi.Instance.CanUndo(); }
        }

        public override void Execute(IControlUI controlUi)
        {
            TodoApi.Instance.Undo();
        }
    }
}